<?php if (Yii::app()->session["member_level"] != "admin" and Yii::app()->session["member_id"] == NULL): 
echo $this->redirect(Yii::app()->homeUrl);
endif; ?>
<div class="panel">
    <?php echo $this->beginContent("/report/Toolbar", array("current" => 1)); ?>
    <?php echo $this->endContent(); ?>

    <div class="panel_body">
<?php
    $this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'index',   
    'dataProvider' => $dataProvider,   
    'htmlOptions' => array('width' => '500px'),
    'enablePagination' => true,   
    'columns' => array(   
        array(
            'name' => 'id',
            'header' => 'ID',
        ),
        array(
            'name' => 'order_date',
            'header' => 'วันที่',
        ),
	array(
            'name' => 'member_firstname',
            'header' => 'ชื่อ',
//            'value' => 'CHtml::link($data->member_firstname, array("Report/ReportOrderDetail", "id" => $data->member_id))',
            'htmlOptions' => array(
                        'width' => '100px',
                        'align' => 'center'),
        ),
        array(
            'name' => 'member_lastname',
            'header' => 'นามสกุล',
        ),
        array(
            'name' => 'payment_type_name_thai',
            'header' => 'ประเภทการชำระเงิน',
        ),
        array(
            'name' => 'order_amount',
            'header' => 'จำนวนเงิน',
        ),
        array(
            'name' => 'order_tracking_status',
            'header' => 'สถานะการดำเนินการ',
        ),
        array(
                    'header' => 'รายละเอียด',
                    'class' => 'CLinkColumn',
                    'imageUrl' => 'images/delete.png',
                    'urlExpression' => 'Yii::app()->createUrl("Report/ReportOrderDetail", array("id" => $data["id"]))',
                    'htmlOptions' => array(
                        'width' => '35px',
                        'align' => 'center',
//                        'onclick' => 'return confirm("ยืนยันการลบ")'
                    )
                )
    ),
));
?>
    </div>
</div>